package com.jia.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jia.dto.admin.CoordinateDto;
import com.jia.entity.Coordinate;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jia.vo.admin.CoordinateVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 贾天旺
* @description 针对表【t_coordinate】的数据库操作Mapper
* @createDate 2024-04-28 09:22:25
* @Entity com.jia.entity.Coordinate
*/
public interface CoordinateMapper extends BaseMapper<Coordinate> {

    Page<CoordinateVo> COORDINATE_VOS(@Param("page")Page<CoordinateVo> page,@Param("coordinateDto") CoordinateDto coordinateDto);

    //省
    @Select("select DISTINCT province from t_address")
    List<String> provinceList();


    //市
    @Select("select DISTINCT city from t_address where province=#{province}")
    List<String> cityList(@Param("province")String province);

    //区
    @Select("select DISTINCT district from t_address where city=#{city}")
    List<String> districtList(@Param("city")String city);


    @Select("select * from t_coordinate a,t_address b where a.aid=b.id and b.state=0")
    List<Coordinate> list();
}




